package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.dto.IndexLoginDTO;
import com.ydd.entity.Page.HotAtricle;
import com.ydd.entity.Page.NewUserMessage;
import com.ydd.entity.YddUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (YddCate)表数据库访问层
 *
 * @author makejava
 * @since 2023-04-29 12:08:38
 */
@Mapper
public interface YddUserMapper extends BaseMapper<YddUser>{
    @Select("select count(*) from ydd_user")
    Integer gettotalNumber();
    @Select("select count(*) from ydd_user where sex=1")
    Integer getMantotalNumber();

    @Select("select id,username,sex,icon,address from ydd_user order by id desc  limit 0,7")
    List<NewUserMessage> get7userList();

    /**
     * 用户登录
     * @param mobile
     * @return
     */
    YddUser login(String mobile);

    /**
     * 根据id获取用户
     * @param userId
     * @return
     */
    YddUser getByYddUserId(String userId);
}

